import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:nyh_motorcade_app/styles/colors.dart';

class ToastUtils {
  static void toast(
    String? msg, {
    ToastGravity? gravity = ToastGravity.BOTTOM,
    Color? backgroundColor = Colours.color_black,
  }) {
    if (msg == null || msg.isEmpty) {
      return;
    }
    Fluttertoast.showToast(
      msg: msg,
      toastLength: Toast.LENGTH_SHORT,
      gravity: gravity,
      backgroundColor: backgroundColor,
    );
  }

  static void cancel() {
    Fluttertoast.cancel();
  }
}
